{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Autumn\n", "\n", "Notebook by Doug Blank\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "application/javascript": [ "\n", " var component = document.getElementById(\"sketch_1\");\n", " if (component != undefined)\n", " component.remove();\n", " component = document.getElementById(\"state_1\");\n", " if (component != undefined)\n", " component.remove();\n", " component = document.getElementById(\"controls_div_1\");\n", " if (component != undefined)\n", " component.remove();\n", " require([window.location.protocol + \"//calysto.github.io/javascripts/processing/processing.js\"], function() {\n", " // FIXME: Stop all previously running versions (?)\n", " var processingInstance = Processing.getInstanceById(\"canvas_1\");\n", " if (processingInstance != undefined && processingInstance.isRunning())\n", " processingInstance.noLoop();\n", " });\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "
\n", " Sketch #1:
\n", "
\n", "
\n", "
\n", " \n", " \n", " \n", " \n", "
\n", "Sketch #1 state: Loading...
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "void setup() {\n", " size(200, 100);\n", "}\n", "\n", "void draw() {\n", " drawLeaf(50, 50, 20, 20);\n", " drawLeaf(120, 50, 70, 70);\n", "}\n", "\n", "void drawLeaf(float x, float y, float w, float h) {\n", " fill(255);\n", " float p1x = x - w * 0.6;\n", " float p1y = y;\n", " float p2x = x + w * 0.4;\n", " float p2y = y - h * 0.7;\n", " float p3x = x;\n", " float p3y = y + h * 0.3;\n", " triangle(p1x, p1y, p2x, p2y, p3x, p3y);\n", " fill(0, 255, 0);\n", " ellipse(x, y, 5, 5);\n", "}" ] } ], "metadata": { "kernelspec": { "display_name": "Calysto Processing", "language": "java", "name": "calysto_processing" }, "language_info": { "codemirror_mode": { "name": "text/x-java", "version": 2 }, "file_extension": ".java", "mimetype": "text/x-java", "name": "java" } }, "nbformat": 4, "nbformat_minor": 0 }